//
//  DX.h
//

#import <Foundation/Foundation.h>

#ifdef DEBUG
    #define HOST                                                @"http://api.yuntick.com/express/client"
#else
    #define HOST                                                @"http://api.yuntick.com/express/client"
#endif
#define IMG_HOST                                            @"https://static.yuntick.com"
#define CLIENT                                              @"1"
#define VERSION                                             1
#define VERSION_NUMBER                                      @"1.0"
#define NET_REQUEST_TIMEOUT_INTERVAL                        30

#define MQ_HOST                                             @"api.yuntick.com"
#define MQ_PORT                                             61613
#define MQ_USERNAME                                         @"express_test"
#define MQ_PASSWORD                                         @"express_test"
#define MQ_VIRTUAL_HOST                                     @"express_test"

//#define MQ_USERNAME                                         @"express"
//#define MQ_PASSWORD                                         @"express@2014"
//#define MQ_VIRTUAL_HOST                                     @"express"

#define AMAP_KEY                                            @"40ec4490bcb2acdc2c9f5b8725f2baac"

#define NOTIFICATION_SHOULD_LOGOUT                          @"notification-name-should-logout"
#define NOTIFICATION_MESSAGE_RECEIVED                       @"notification-name-message-received"
#define NOTIFICATION_ALIPAY_COMPLETE                        @"notification-alipay-complete"
#define NOTIFICATION_WXPAY_SUCCESS                          @"notification-wxpay-success"

#define API_VERSION                                         @"105"

#define API_ACTION_USER_LOGIN                               @"user/login"
#define API_ACTION_USER_REG_WX                              @"user/register-by-wx"
#define API_ACTION_USER_LOGIN_WX                            @"user/login-by-wx"
#define API_ACTION_USER_REGISTER                            @"user/register"
#define API_ACTION_USER_PASSWORD_RESET                      @"user/password-reset"
#define API_ACTION_USER_LOGOUT                              @"user/logout"
#define API_ACTION_USER_INFO                                @"user/basic-info"
#define API_ACTION_USER_PASSWORD_UPDATE                     @"user/password-update"
#define API_ACTION_USER_BASIC_INFO_UPDATE                   @"user/basic-info-update"
#define API_ACTION_USER_AVATAR_UPDATE                       @"user/avatar-update"
#define API_ACTION_USER_PHONE_UPDATE                        @"user/phone-update"
#define API_ACTION_USER_ADDRESS_LIST                        @"user/address-list"
#define API_ACTION_USER_ADDRESS_SAVE                        @"user/address-save"
#define API_ACTION_USER_ADDRESS_DELETE                      @"user/address-delete"
#define API_ACTION_USER_ADDRESS_SET_AS_DEFAULT              @"user/address-set-as-default"
#define API_ACTION_USER_ADDRESS_LIST_FROM                   @"user/address-list-from"
#define API_ACTION_USER_ADDRESS_LIST_TO                     @"user/address-list-to"
#define API_ACTION_USER_LOGIN_TYPE                          @"user/outer-account-list"
#define API_ACTION_USER_LOGIN_TYPE_BIND                     @"user/outer-account-bind"
#define API_ACTION_USER_LOGIN_TYPE_UNBIND                   @"user/outer-account-unbind"
#define API_ACTION_USER_OUTER_ACCOUNT_INFO_UPDATE           @"user/outer-account-info-update"
#define API_ACTION_FAVOURITE_COURIER_ADD                    @"user/favourite-courier-add"
#define API_ACTION_FAVOURITE_COURIER_DELETE                 @"user/favourite-courier-delete"
#define API_ACTION_FAVOURITE_COURIER_LIST                   @"user/favourite-courier-list"

#define API_ACTION_PHONE_VERIFICATION_CODE_SEND             @"common/phone-verification-code-send"
#define API_ACTION_PHONE_VERIFICATION_CODE_CHECK            @"common/phone-verification-code-check"
#define API_ACTION_CRASH_REPORT                             @"common/crash-report-ios-create"
#define API_ACTION_FEEDBACK_SAVE                            @"common/feedback-save"

#define API_ACTION_COURIER_LIST_NEARBY                      @"courier/list-nearby"
#define API_ACTION_EXPRESS_ORG_LIST                         @"courier/express-org-list"
#define API_ACTION_COURIER_LIST_SEARCH_BY_DISTANCE          @"courier/list-search-by-distance"
#define API_ACTION_COURIER_LIST_SEARCH_BY_EXPRESS_ORG       @"courier/list-search-by-express-org"
#define API_ACTION_COURIER_LIST_SEARCH_BY_RATE              @"courier/list-search-by-rate"
#define API_ACTION_COURIER_INFO                             @"courier/detail"
#define API_ACTION_COURIER_LOCATION                         @"courie/location"
#define API_ACTION_COURIER_RATE_LIST                        @"courier/rate-list"

#define API_ACTION_WAYBILL_LIST                             @"uapi/waybill-list"
#define API_ACTION_CALL_COURIER                             @"waybill/courier-call"
#define API_ACTION_CALL_NEARBY_COURIER                      @"waybill/courier-nearby-call"
#define API_ACTION_WAYBILL_SAVE                             @"waybill/waybill-save"
#define API_ACTION_WAYBILL_RATE_SAVE                        @"waybill/rate-save"
#define API_ACTION_WAYBILL_DELIVER_LIST                     @"waybill/list-deliver"
#define API_ACTION_WAYBILL_RECEIVE_LIST                     @"waybill/list-receive"
#define API_ACTION_WAYBILL_INFO                             @"waybill/detail"
#define API_ACTION_WAYBILL_IMG_LIST                         @"waybill/img-list"
#define API_ACTION_WAYBILL_STATUS_UPDATE_RECEIVE_SUCCESS    @"waybill/status-update-receive-success"
#define API_ACTION_WAYBILL_STATUS_UPDATE_CANCEL             @"waybill/status-update-cancel"
#define API_ACTION_WAYBILL_STATUS_UPDATE_DELIVER_SUCCESS    @"waybill/status-update-deliver-success"
#define API_ACTION_WAYBILL_COMPLAIN_SAVE                    @"waybill/complain-save"
#define API_ACTION_WAYBILL_COMPLAIN_LIST                    @"waybill/complain-list"
#define API_ACTION_WAYBILL_TO_CUSTOMER_AGENT_SAVE           @"waybill/to-customer-agent-save"
#define API_ACTION_WAYBILL_BONUS_RECEIVE_UPDATE             @"waybill/bonus-receive-update"
#define API_ACTION_WAYBILL_BONUS_DELIVER_UPDATE             @"waybill/bonus-deliver-update"
#define API_ACTION_WAYBILL_IMG_SAVE                         @"waybill/img-save"
#define API_ACTION_WAYBILL_CABINET_LIST_NEARBY              @"waybill/cabinet-list-nearby"
#define API_ACTION_WAYBILL_CABINET_DETAIL                   @"waybill/cabinet-detail"
#define API_ACTION_WAYBILL_CREATE                           @"waybill/cabinet-waybill-create"
#define API_ACTION_WAYBILL_PAY_CREATE                       @"waybill/pay/create"
#define API_ACTION_WAYBILL_CABINET_LIST_NEARBY              @"waybill/cabinet-list-nearby"
#define API_ACTION_WAYBILL_CABINET_DETAIL                   @"waybill/cabinet-detail"
#define API_ACTION_WAYBILL_CABINET_WAYBILL_CREATE           @"waybill/cabinet-waybill-create"

#define API_ACTION_PAY_WAYBILL_PAY_CREATE                   @"pay/waybill-pay-create"
#define API_ACTION_PAY_CREATE                               @"pay/create"
#define API_ACTION_WAYBILL_PAY_STATUS                       @"pay/waybill-pay-status"
#define API_ACTION_PAY_STATUS                               @"pay/status"
#define API_ACTION_PAY_DETAIL                               @"pay/detail"

#define API_ACTION_COURIER_MESSAGE_SEND                     @"message/send-to-courier"
#define API_ACTION_LIST_CHAT_WITH_COURIER                   @"message/list-chat-with-courier"

#define PAY_TYPE_ALIPAY                                     @"1"
#define PAY_TYPE_WXPAY                                      @"2"
#define PAY_TARGET_TYPE_RECEIVE                             @"1"
#define PAY_TARGET_TYPE_DELIVER                             @"2"

#define ERROR_PARAM_NOT_SET                                 1
#define ERROR_TOKEN_INVALID                                 2
#define ERROR_WRONG_TYPE                                    3
#define ERROR_WRONG_NAME                                    4
#define ERROR_WRONG_PASSWORD                                5
#define ERROR_WRONG_PARAM                                   6
#define ERROR_SAVE_ERROR                                    7
#define ERROR_NOT_EXIST                                     8
#define ERROR_EXIST                                         9
#define ERROR_ACTION_NOT_ALLOWED                            10
#define ERROR_COURIER_NAME_ILLEGAL                          11
#define ERROR_UNKNOWN_POST_ACTION                           12
#define ERROR_REGION                                        13
#define ERROR_MSG_INVALID_TYPE                              14
#define ERROR_ACTION_ERROR                                  15
#define ERROR_WAYBILL_REGION                                16
#define ERROR_WRONG_VERIFICATION_CODE                       17
#define ERROR_GEO_CODE_FAIL                                 18
#define ERROR_NOT_PAYED                                     19

#define DATA_SEARCH_WAYBILL_HISTORY_RECORD                  @"data-search-waybill-history-record"

#define PARAM_FIRST_OPEN                                    @"param-first-open"

#define PARAM_SELECTED_USER_ADDRESS_TO                      @"param-selected-user-address-to"
#define PARAM_SELECTED_USER_ADDRESS_FROM                    @"param-selected-user-address-from"
#define PARAM_SENDING_WAYBILL_ID                            @"param-sending-waybill-id"
#define PARAM_SENDING_WAYBILL                               @"param-sending-waybill"
#define PARAM_SENDING_WAYBILL_STATUS                        @"param-sending-waybill-status"
#define PARAM_SHOULD_RELOAD_WAYBILL_LIST                    @"param-should-reload-waybill-list"
#define PARAM_BAR_CODE                                      @"param-bar-code"
#define PARAM_SENDING_WAYBILL_SENG_COURIER_ID               @"param-sending-waybill-send-courier-id" // 0: not send to one courier

#define SENDING_WAYBILL_STATUS_INIT                         0
#define SENDING_WAYBILL_STATUS_WAITING                      1
#define SENDING_WAYBILL_STATUS_RECEIVING                    2
#define SENDING_WAYBILL_STATUS_WAITING_ONE_COURIER          3

#define MESSAGE_TYPE_SYSTEM_WAYBILL_USER_CALL_COURIER       10001
#define MESSAGE_TYPE_SYSTEM_WAYBILL_COURIER_COMPETE_SUCCESS 10002
#define MESSAGE_TYPE_SYSTEM_WAYBILL_USER_CANCEL_WAYBILL     10003

#define WAYBILL_RATE_TYPE_RECEIVE                           1
#define WAYBILL_RATE_TYPE_DELIVER                           2

#define WAYBILL_EACH_PAGE                                   10

#define ALIPAY_PARTNER                                      @"2088811669761425"
#define ALIPAY_SELLER                                       @"yunqi@yuntick.com"
#define ALIPAY_NOTIFY_URL                                   @"http://api.yuntick.com/pay/alipay-notify"

#define WX_APP_ID                                           @"wx02132c6a31d8b606"
#define WX_APP_SECRET                                       @"a340585a399d4d6e7a52729c882fbe31"
#define WX_PAY_MERCHANT_ID                                  @"1233127802"
#define WX_PAY_KEY                                          @"942483bf94f5f475a917014c858da039"

#define WEIBO_APP_ID                                        @"2074467674"
#define WEIBO_APP_SECRET                                    @"9d16098c7d7fe1c7caaf1157355ab017"

#define SHARE_TITLE                                         @"快递宝贝，宝贝就在路上"
#define SHARE_CONTENT                                       @"快递宝贝，马上下载：http://yuntick.com/app/express-client，宝贝就在路上！"
#define SHARE_LINK                                          @"http://yuntick.com/app/express-client"

@interface DX : NSObject

@property(nonatomic) BOOL Debug;

+ (id)sharedInstance;

@end
